package com.zhuhanpeng.cloud.role.repository;


import com.zhuhanpeng.cloud.mybatis.entity.PtRoleEntity;
import com.zhuhanpeng.cloud.mybatis.flexigrid.PagingEntity;
import com.zhuhanpeng.cloud.mybatis.ztree.ZtreeEntity;
import com.zhuhanpeng.cloud.role.entity.SearchRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleDao {
    Integer queryRoleListTotal(@Param("entity") SearchRoleEntity entity);

    List<PtRoleEntity> queryRoleListByPage(@Param("entity") SearchRoleEntity entity, @Param("paging") PagingEntity paging);
    /**
     * 查询菜单ztree列表
     * @return
     */
    List<ZtreeEntity> queryMenuZtreeList();
    /**
     * 根据角色删除菜单的关系
     * @param roleUuid
     */
    void deleteMenuByRole(@Param("roleUuid") String roleUuid);

    /**
     * 插入角色和菜单的关系
     * @param menuId
     * @param roleUuid
     */
    void insertRoleRefMenu(@Param("menuId") String menuId,@Param("roleUuid") String roleUuid);

    /**
     * 根据角色id查询菜单id
     * @param roleUuid
     * @return
     */
    List<String> queryMenuByRole(@Param("roleUuid") String roleUuid);

    /**
     * 根据id增加角色
     * @param entity
     * @return
     */
    void addroleInfoById(@Param("entity")PtRoleEntity entity);

    /**
     * 根据id删除角色
     * @param roleUuid
     * @return
     */
    void deleteRoleInfo(@Param("roleUuid")String roleUuid);

    /**
     * 根据uid查角色
     * @param roleUuid
     * @return
     */
    PtRoleEntity queryRoleByRoleId(@Param("roleUuid")String roleUuid);

    /**
     * 根据entity查角色
     * @param entity
     * @return
     */
    void updateRoleInfoById(@Param("entity")PtRoleEntity entity);
}